//
//  Contact.m
//  Homework_17(2)
//
//  Created by 徐昊 on 16/8/6.
//  Copyright © 2016年 徐昊. All rights reserved.
//

#import "Contact.h"

@implementation Contact
// 重写KVC方法
- (void)setValue:(id)value forUndefinedKey:(NSString *)key {
    
}
- (instancetype)initWithCoder:(NSCoder *)aDecoder {
    self = [super init];
    if (self) {
        _image = [aDecoder decodeObjectForKey:@"image"];
        _name = [aDecoder decodeObjectForKey:@"name"];
        _phoneNumber = [aDecoder decodeObjectForKey:@"phoneNumber"];
        _address = [aDecoder decodeObjectForKey:@"address"];
    }
    return self;
}
- (void)encodeWithCoder:(NSCoder *)aCoder {
    [aCoder encodeObject:_image forKey:@"image"];
    [aCoder encodeObject:_name forKey:@"name"];
    [aCoder encodeObject:_phoneNumber forKey:@"phoneNumber"];
    [aCoder encodeObject:_address forKey:@"address"];
}
@end
